import request from '@/utils/request'; // 自定义的请求工具

export function getAllPayments() {
    return request({
        url: '/payment/all',
        method: 'get'
    });
}

export function addPayment(data) {
    return request({
        url: '/payment',
        method: 'post',
        data
    });
}

export function updatePayment(data) {
    return request({
        url: `/payment/${data.paymentId}`, // 请求 URL 中包含用户 ID
        method: 'put',
        data
    });
}

export function deletePayment(id) {
    return request({
        url: `/payment/${id}`,
        method: 'delete'
    });
}

export function getPaymentById(id) {
    return request({
        url: `/payment/${id}`,
        method: 'get'
    });
}


